package com.redrose.demo.main;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

import com.redrose.demo.bean.ListItem;
import com.redrose.demo.multiple.BaseMultipleViewHolder;

public abstract class Home<T extends ViewDataBinding> extends BaseMultipleViewHolder<ListItem> {
    T bind;

    public Home(ViewGroup parent, View view) {
        super(view);
        bind = getBind(parent);
    }

    @Override
    protected abstract void bindView(ListItem bean);

    private T getBind(ViewGroup parent) {
        LayoutInflater inflater = LayoutInflater.from(itemView.getContext());
//        return DataBindingUtil.inflate(inflater, bean.getLayoutResId(),parent , false);
        return DataBindingUtil.getBinding(itemView);
    }
}
